/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package MyThread;

import com.ideal.log.Log;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Huyu
 */
public class BCMCReadThread extends Thread {
    
    private final ReadWriteLock m_lock;
    public BCMCReadThread(ReadWriteLock lock){
        m_lock = lock;
    }
   
    @Override
    public void run() {

        try {
            while (true) {
                m_lock.readLock().lock();
                Log.logger.info("BCMCReadThread read");
                Thread.sleep(1000);
                m_lock.readLock().unlock();
            }

        } catch (InterruptedException ex) {

        }
    }

}
